﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace Warlock.Input
{
    // === MOUSE CLICK STATUS ===
    public enum MouseButton
    {
        Left,
        Right,
        Middle,
    }
    // === MOUSE MOVED ===
    public delegate void MouseMovedEventHandler(MouseMovedEventArgs e);
    public class MouseMovedEventArgs
    {
        public Vector2 OldPosition;
        public Vector2 NewPosition;
        public MouseState MouseState;
        public MouseMovedEventArgs(Vector2 oldPos, Vector2 newPos, MouseState mouseState)
        {
            OldPosition = oldPos;
            NewPosition = newPos;
            MouseState = mouseState;
        }
    }

    // === MOUSE CLICK ===
    public delegate void MouseClickEventHandler(MouseClickEventArgs e);
    public class MouseClickEventArgs
    {
        public MouseState CurrentMouseState;
        public MouseState PreviousMouseState;
        public MouseButton MouseButton;
        public Vector2 MousePosition;
        public MouseClickEventArgs(MouseState currentMouseState, MouseState previousMouseState, MouseButton mouseButton, Vector2 mousePosition)
        {
            CurrentMouseState = currentMouseState;
            PreviousMouseState = previousMouseState;
            MouseButton = mouseButton;
            MousePosition = mousePosition;
        }
    }

    // === KEY PRESSED ===
    public delegate void KeyDownEventHandler(KeyPressedEventArgs e);
    public delegate void KeyUpEventHandler(KeyPressedEventArgs e);
    /// <summary>
    /// Wird einmalig aufgerufen, wenn eine Taste gedrueckt und wieder losgelassen wurde.
    /// </summary>
    public delegate void KeyPressedEventHandler(KeyPressedEventArgs e);
    public class KeyPressedEventArgs
    {
        public Keys Key;
        public List<Keys> PressedKeys;
        public KeyPressedEventArgs(Keys key, List<Keys> pressedKeys)
        {
            Key = key;
            PressedKeys = pressedKeys;
        }
    }
}